package com.exam.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.exam.annotation.Cache;
import com.exam.entity.ExamRecord;
import com.exam.vo.PageResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.concurrent.TimeUnit;

/**
 * @author 小聋包
 * @date 2024-04-25 19:22
 * @Version 1.0
 */
public interface ExamRecordService extends IService<ExamRecord> {
    void setObjectQuestionScore(Integer totalScore,Integer examRecordId);

    PageResponse<ExamRecord> getUserGrade(String username, Integer examId, Integer pageNo, Integer pageSize);

    void createExamCertificate(HttpServletResponse response, String decode, Integer examRecordId);

    @Cache(prefix = "exam:record", suffix = "#recordId", ttl = 10, randomTime = 2, timeUnit = TimeUnit.HOURS)
    ExamRecord getExamRecordById(Integer recordId);

    Integer addExamRecord(ExamRecord examRecord, HttpServletRequest request);
}
